<template>
  <div class="template-wrap">
    <menu-top></menu-top>
    <div class="content">
      <div class="content-wrap">
        <div>
          <menu-left ref="left" :href="href"></menu-left>
        </div>
        <el-col>
          <div class="repayment-wrap right-content">
            <el-breadcrumb separator-class="el-icon-arrow-right">
              <el-breadcrumb-item :to="{ path: '/ccOrderHand' }">我的订单</el-breadcrumb-item>
              <el-breadcrumb-item>还款中订单</el-breadcrumb-item>
            </el-breadcrumb>
            <div class="wrap">
                <rotate-message></rotate-message>
                <div class="wrap-container">
                    <div class="title">还款中订单</div>
                    <div class="state-wrap">
                    <!-- <div class="state-list">最近还款日期：<span>23</span></div> -->
                    <!-- <div class="btn">详情</div> -->
                    </div>
                </div>
                <div class="info-main">
                    <div v-if="list.length && list.length > 0">
                      <div class="order-item" v-for="(item, index) in list" :key="index">
                          <div class="product-item">
                              <div class="product-list">
                                  <div class="loan-comment">融资企业：{{item.orderBankData.masterOrder.coreData.companyName}}</div>
                                  <div class="loan-comment" v-for="(data, index) in item.loanCommentDatas" :key="index">
                                    {{data.name}}：{{data.value}}
                                  </div>
                              </div>
                          </div>
                          <div class="info-wrap">
                              <div class="info-title">产品信息</div>
                              <div class="info-list">
                                <div class="info">产品名称：<span class="name">{{item.orderBankData.masterOrder.productData.productName}}</span></div>
                                <div class="info">
                                  <div class="info-item">
                                    贷款额度：<span>{{item.orderBankData.masterOrder.productData.loanFundMin}}万 ~ {{item.orderBankData.masterOrder.productData.loanFundMax}}万</span>
                                  </div>
                                  <div class="info-item">
                                    贷款适用地区：<span>{{item.orderBankData.masterOrder.productData.financingProvinceName || '--'}}{{item.orderBankData.masterOrder.productData.financingCityName}}</span>
                                  </div>
                                </div>
                                <div class="info">
                                  <div class="info-item">
                                    贷款最高期限：<span>{{item.orderBankData.masterOrder.productData.investYearDesc}}</span>
                                  </div>
                                  <div class="info-item">
                                    申请者最低成立年限：<span>{{item.orderBankData.masterOrder.productData.applyMixYear + '年'}}</span>
                                  </div>
                                </div>
                                <div class="info">
                                  <div class="info-item">
                                    贷款年化利率：<span>{{item.orderBankData.masterOrder.productData.minReportRate + '%/年'}}</span>
                                  </div>
                                  <div class="info-item">
                                    申请者盈利要求：<span>{{item.orderBankData.masterOrder.productData.applyProfit == 'y'?'需盈利':'无要求'}}</span>
                                  </div>
                                </div>
                                <div class="info">
                                  <div class="info-item">
                                    资金主体：<span>{{
                                      item.orderBankData.masterOrder.productData.fundBodyDatas.length > 0 
                                      ? item.orderBankData.masterOrder.productData.fundBodyDatas.map(item => item.fundBodyDesc).join(',')
                                      : '暂无'}}</span>
                                  </div>
                                  <div class="info-item">
                                    申请者最低营业收入要求：<span>{{item.orderBankData.masterOrder.productData.applyMixIncome}}</span>
                                  </div>
                                </div>
                              </div>
                              <div class="info-detail">
                                  <div class="detail-list">资方：<span class="name">{{item.orderBankData.subBankData.bankName}}</span></div>
                                  <div class="detail-list">成立时间：<span>{{item.orderBankData.baseDTO.coreData.regdate.substr(0,10)}}</span></div>
                                  <div class="detail-list">注册资本：<span>{{item.orderBankData.baseDTO.coreData.regMoney || '--'}}</span></div>
                                  <div class="detail-list">企业类型：<span>{{item.orderBankData.baseDTO.coreData.thirdIndustryDesc || '--'}}</span></div>
                                  <!-- <div class="btn">详情</div> -->
                              </div>
                          </div>
                      </div>
                    </div>
                    <div class="data-empty" v-else>
                      暂无数据
                    </div>
                    <el-pagination v-if="total != 0"
                      class="pagination"
                      layout="prev, pager, next"
                      :current-page="currentPage"
                      :current-change="handleCurrentChange"
                      :total="total">
                    </el-pagination>
                </div>
            </div>
          </div>
        </el-col>
      </div>
    </div>
  </div>
</template>

<script>
import VueRouter from "vue-router";
import { requestAjax, returnNum } from "../../../common.js";
import urlContant from "../../../constant/constant.js";
export default {
  data() {
    return {
      href: "",
      currentPage: 1,
      total: 1,
      list: []
    };
  },
  created() {
    this.loadData(1);
  },
  methods: {
    returnNum,
    loadData(pageIndex) {
      const url = urlContant.URL.SYSTEM.ORDERBANKLOAN;
      const params = {
        pageIndex,
        pageSize: 5
      };
      requestAjax(url, JSON.stringify({}), params, ({ data, status }) => {
        if (status == 200) {
          this.list = data.bussData;
          this.total = data.count;
          this.currentPage = pageIndex
        }
      });
    },
    loadUserList(userType = "company") {
      const url = urlContant.URL.SYSTEM.USERLIST;
      const params = { userType };
      requestAjax(url, JSON.stringify(params), {}, ({ status, data }) => {
        if (status == 200) {
          if (userType == "company") {
            this.companys = data.bussData;
          } else {
            this.banks = data.bussData;
          }
        }
      });
    },
    loadProductList() {
      const url = urlContant.URL.SYSTEM.PRODUCTLIST;
      const params = {};
      requestAjax(url, "{}", params, ({ status, data }) => {
        if (status == 200) {
          this.productList = data.bussData;
        }
      });
    },
    handleCurrentChange(current) {
      this.loadData(current)
    }
  },
  components: {
    "menu-top": () => import("../../common/Menu-Top"),
    "menu-left": () => import("../../common/Menu-Left"),
    "rotate-message": () => import("../../common/rotate-message")
  }
};
</script>

<style  lang="scss" scoped>
body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Avenir", Helvetica, Arial, sans-serif;
}

.content {
  min-height: 100%;
  background-color: #f5f5f5;
  width: 81.3%;
  float: right;
}

.content-wrap {
  overflow: hidden;
}

.order-item {
  // background-color: #f2f2f2;
  padding-left: 20px;
  padding-right: 20px;
  margin-bottom: 30px;
  border-radius: 4px;
  border: 1px solid #f2f2f2;
}

.data-empty {
  text-align: center;
  line-height: 40px;
  font-size: 16px;
}

.loan-comment {
  display: inline;
  font-size: 16px;
  color: #999999;
  margin-right: 50px;
}

.repayment-wrap {
  padding-top: 29px;
  .wrap {
    background-color: #f5f5f5;
    .title-head {
      height: 50px;
      line-height: 50px;
      background-color: #fff;
      margin-top: 18px;
      padding-left: 20px;
      font-size: 14px;
      color: #666;
      span {
        color: #0087dc;
        cursor: pointer;
      }
    }
    .wrap-container {
      padding: 11px 60px 0px 29px;
      margin-top: 20px;
      background-color: #fff;
      .title {
        height: 56px;
        line-height: 56px;
        font-size: 20px;
      }
      .filter-wrap {
        background-color: #fff;
        overflow: hidden;
        padding-bottom: 20px;
        border-bottom: 1px solid #d1d1d1;
        .filter-list {
          float: left;
          overflow: hidden;
          margin-right: 50px;
          margin-top: 20px;
          .name {
            font-size: 16px;
            color: #666;
            float: left;
            height: 40px;
            line-height: 40px;
          }
          .el-select {
            width: 220px;
            margin-left: 20px;
            height: 40px;
          }
        }
        .btn-filter {
          margin-top: 20px;
          float: left;
          width: 100px;
          height: 40px;
          border-radius: 4px;
          -webkit-border-radius: 4px;
          background-color: #ed7018;
          font-size: 18px;
          color: #fff;
          text-align: center;
          line-height: 40px;
          cursor: pointer;
          &:hover {
            background-color: #ed9000;
            transition: all 0.2s linear;
          }
        }
      }
      .state-wrap {
        overflow: hidden;
        background-color: #fff;
        // border-bottom: 1px solid #d1d1d1;
        .state-list {
          float: left;
          line-height: 14px;
          margin-top: 30px;
          margin-bottom: 10px;
          font-size: 16px;
          color: #666;
          margin-right: 150px;
          span {
            color: #111;
            // font-weight: bold;
          }
        }
        .btn {
          float: left;
          width: 100px;
          height: 40px;
          border-radius: 4px;
          -webkit-border-radius: 4px;
          background-color: #ed7018;
          font-size: 18px;
          color: #fff;
          text-align: center;
          line-height: 40px;
          cursor: pointer;
          &:hover {
            background-color: #ed9000;
            transition: all 0.2s linear;
          }
        }
      }
    }
    .product-item {
      margin-top: 9px;
      .product-list {
        // margin-top: 30px;
        overflow: hidden;
        padding-bottom: 20px;
        border-bottom: 1px solid #e1e1e1;
        padding-top: 31px;
        &:first-child {
          border-top: 0px solid #000;
        }
        img {
          float: left;
          width: 24.167%;
          height: 194px;
          margin-right: 2.67%;
        }
        .btn {
          position: absolute;
          right: 0px;
          top: 90px;
          width: 100px;
          height: 40px;
          background-color: #ed7018;
          border-radius: 4px;
          -webkit-border-radius: 4px;
          font-size: 18px;
          color: #fff;
          text-align: center;
          line-height: 40px;
          cursor: pointer;
          &:hover {
            background-color: #ed9000;
            transition: all 0.2s linear;
          }
        }
        .list-info {
          position: relative;
          float: left;
          overflow: hidden;
          width: 58%;
          .date {
            position: absolute;
            right: 0;
            top: 9px;
            font-size: 14px;
            color: #999;
          }
          .title1 {
            font-size: 18px;
            color: #111;
            font-weight: bold;
          }
          .list-line {
            float: left;
            width: 49%;
            font-size: 16px;
            color: #111;
            .line-item {
              margin-top: 21px;
            }
            span {
              color: #666;
            }
            &:last-child {
              width: 39%;
            }
          }
        }
      }
    }
    .info-wrap {
      // background-color: #fff;
      padding: 22px 0 29px 0;
      // border-bottom: 1px solid #d1d1d1;
      overflow: hidden;
      .info-title {
        width: 35%;
        font-size: 16px;
        color: #333;
        font-weight: bold;
      }
      .infos-list {
        overflow: hidden;
      }
      .info-list {
        width: 50%;
        float: left;
        font-size: 16px;
        color: #666;
        span.name {
          color: #ed7018;
        }
        .info {
          overflow: hidden;
          margin-top: 25px;
          .info-item {
            width: 38%;
            float: left;
            &:nth-child(2) {
              float: left;
              margin-left: 20%;
            }
          }
          span {
            color: #111;
            // font-weight: bold;
          }
        }
      }
      .info-detail {
        position: relative;
        top: 25px;
        width: 30.1%;
        float: right;
        margin-right: 7%;
        height: 180px;
        background-color: #e2e2e2;
        padding-top: 30px;
        .detail-list {
          font-size: 16px;
          color: #666;
          padding-left: 10%;
          margin-bottom: 20px;
          span {
            color: #333;
            &.name {
              /*cursor: pointer;*/
              color: #ed7018;
            }
          }
        }
        .btn {
          position: absolute;
          top: 80px;
          right: 7%;
          width: 100px;
          height: 40px;
          border-radius: 4px;
          -webkit-border-radius: 4px;
          background-color: #999999;
          font-size: 18px;
          color: #fff;
          text-align: center;
          line-height: 40px;
          cursor: pointer;
          &:hover {
            background-color: #888;
            transition: all 0.2s linear;
          }
        }
      }
    }
    .info-main {
      padding: 11px 60px 33px 29px;
      background-color: #fff;
    }
  }
}

a {
  text-decoration: none;
}
</style>